/*
 * Copyright 2008 CSC Consulting Group under the Apache License, 
 * Version 2.0 (the "License"); you may not use this file except in 
 * compliance with the License. You may obtain a copy of the License at 
 * http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable 
 * law or agreed to in writing, software distributed under the License is 
 * distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
 * either express or implied. See the License for the specific language 
 * governing permissions and limitations under the License.
 */
package com.waw.memberMap.plugin;

import java.util.Iterator;

/**
 *A PortalUser is the JavaBean passed to the FreeMarker templates used to show members of a community.
 * A portalUser has String properties used in the display of the member maps.
 *
 * @author jtremlett
 */
public class PortalUser implements Comparable<PortalUser> {
	
	/** The user's name.*/
	String name = "";
	/** The user's userName - the login name */
	String username = "";
	/** The user's email address */
	String email = "";
	/** whether to display the user */
	String display = "yes";
	/** The user's latitude */
	String lat = "";
	/** The user's longitude */
	String lng = "";
	/** The user's avatar ID */
	String avatarID = "-1";
	/** A properties field holding the user's profile */
	Iterator<PortalProfileField> profile = null;
	
	/** Getter for the name property */
	public String getName() {
		return name;
	}
	
	/** Setter for the name property */
	public void setName(String name) {
		this.name = name;
	}
	
	/** Getter for the username property */
	public String getUsername() {
		return username;
	}
	
	/** Setter for the username property */
	public void setUsername(String username) {
		this.username = username;
	}
	
	/** Getter for the email property */
	public String getEmail() {
		return email;
	}
	
	/** Setter for the email property */
	public void setEmail(String email) {
		this.email = email;
	}
	
	/** Getter for the Profile Fields property */
	public Iterator<PortalProfileField> getProfile() {
		return profile;
	}
	
	/** Setter for the Profile Fields property */
	public void setProfile(Iterator<PortalProfileField> profile) {
		this.profile = profile;
	}
	
	/** Getter for the latitude  property */
	public String getLat() {
		return lat;
	}
	
	/** Setter for the latitude  property */
	public void setLat(String lat) {
		this.lat = lat;
	}
	
	/** Getter for the longitude  property */
	public String getLng() {
		return lng;
	}
	
	/** Setter for the longitude  property */
	public void setLng(String lng) {
		this.lng = lng;
	}
	
	/** Getter for the avatarID property */
	public String getAvatarID() {
		return avatarID;
	}
	
	/** Setter for the avatarID property */
	public void setAvatarID(String avatarID) {
		this.avatarID = avatarID;
	}
	
	/** Getter for the display property */
	public String getDisplay() {
		return display;
	}
	
	/** Setter for the display property */
	public void setDisplay(String display) {
		this.display = display;
	}

	/**
	 * Compares two PortalUsers' user names.
	 * @see java.lang.Comparable#compareTo(java.lang.Object)
	 */
	public int compareTo(PortalUser other) {
		String thisName = this.getUsername();
		String otherName = other.getUsername();
  	    return thisName.compareTo(otherName);
	}
	
}
